﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using UI.GraphService;

namespace UI
{
    public partial class NestedMasterAdmin : System.Web.UI.MasterPage
    {
		GraphServiceClient client = new GraphServiceClient();
        protected void Page_Load(object sender, EventArgs e)
        {
			if ( !IsPostBack )
			{
				fillddl();

                string selected = Request.QueryString["action"];
                if (selected != null)
                    ddlSelection.Items.FindByText(selected).Selected = true;
			}
		}
        

		internal void fillddl()
		{
			ddlSelection.Items.Add( new ListItem( "Room", "Room" ) );
			ddlSelection.Items.Add( new ListItem("Location" ,"Location"));
			ddlSelection.Items.Add( new ListItem("Walkway","Walkway" ));
		}

        internal string getDropDownItem()
        {
			return ddlSelection.SelectedValue;
        }

		

		protected void ActionEdit(object sender,EventArgs e)
		{
			btnEdit.PostBackUrl = "~/EditForm.aspx?action="+ddlSelection.SelectedValue;
			Response.Redirect( "~/EditForm.aspx?action=" + ddlSelection.SelectedValue );
		}

		protected void ActionAdd(object sender,EventArgs e)
		{
			btnAdd.PostBackUrl = "~/AddForm.aspx" + ddlSelection.SelectedValue;
			Response.Redirect( "~/AddForm.aspx?action=" + ddlSelection.SelectedValue );
		}

		

	

		
    }
}